import request from '../utils/request'

export function getcategory(params) { //分类列表
    return request({
        url: '/api/manage/category/list',
        method: 'GET',
        params:params
    })
}
export function addcategory(data) { //添加分类
    return request({
        url: '/api/manage/category/add',
        method: 'POST',
        data:data
    })
}
export function updatecategory(data) { //修改分类
    return request({
        url: '/api/manage/category/update',
        method: 'POST',
        data:data
    })
}
export function getcategorybyid(params) { //通过ID获取分类
    return request({
        url: '/api/manage/category/info',
        method: 'GET',
        params:params
    })
}
export function getproduct(params) { //获取商品列表
    return request({
        url: '/api/manage/product/list',
        method: 'GET',
        params:params
    })
}
export function searchproduct(params) { //搜索商品
    return request({
        url: '/api/manage/product/search',
        method: 'GET',
        params:params
    })
}
export function updateStatus(data) { //商品上架下架
    return request({
        url: '/api/manage/product/updateStatus',
        method: 'POST',
        data:data
    })
}
export function addProduct(data) { //添加商品
    return request({
        url: '/api/manage/product/add',
        method: 'POST',
        data:data
    })
}
export function getdetail(params) { //获取商品详情
    return request({
        url: '/api/manage/product/info',
        method: 'GET',
        params:params
    })
}
export function getuser(params) { //获取所有用户列表
    return request({
        url: '/api/manage/user/list',
        method: 'GET',
        params:params
    })
}
export function adduser(data) { //添加用户
    return request({
        url: '/api/manage/user/add',
        method: 'POST',
        data:data
    })
}
export function deluser(data) { //删除用户
    return request({
        url: '/api/manage/user/delete',
        method: 'POST',
        data:data
    })
}
export function updateuser(data) { //修改用户
    return request({
        url: '/api/manage/user/update',
        method: 'POST',
        data:data
    })
}
export function getrole(params) { //获取角色列表
    return request({
        url: '/api/manage/role/list',
        method: 'GET',
        params:params
    })
}
export function addrole(data) { //添加角色
    return request({
        url: '/api/manage/role/add',
        method: 'POST',
        data:data
    })
}
export function getorder(params) { //获取订单列表
    return request({
        url: '/api/manage/order/list',
        method: 'GET',
        params:params
    })
}
export function getorderinfo(params) { //获取订单详情
    return request({
        url: '/api/manage/order/info',
        method: 'GET',
        params:params
    })
}
export function searchorder(params) { //订单搜索
    return request({
        url: '/api/manage/order/search',
        method: 'GET',
        params:params
    })
}
export function getsysAttr(params) { //获取规格列表
    return request({
        url: '/api/manage/sysAttr/list',
        method: 'GET',
        params:params
    })
}
export function delsysAttr(data) { //删除规格
    return request({
        url: '/api/manage/sysAttr/delete',
        method: 'POST',
        data:data
    })
}
export function searchsysAttr(params) { //搜索规格
    return request({
        url: '/api/manage/sysAttr/search',
        method: 'GET',
        params:params
    })
}